<?php

$db = new PDO('mysql:host=localhost; dbname=db3', 'root', '12qwas');
$ps = $db->query('select count(*) from students'); //这里只有一列，就是记录的个数
echo "记录个数为：{$ps->fetchColumn()}\n";